package com.gxa.web_admin.controller.drivingManagement;

import com.gxa.common.base.RespResult;
import com.gxa.modules.dto.drivingManagement.QueryTrainMealDTO;
import com.gxa.modules.entity.TrainMeal;
import com.gxa.modules.service.drivingManagementService.TrainMealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/trainMeal")
//@RequiresPermissions(value = {"system:trainMeal"})
public class TrainMealController {//培训套餐管理

    @Autowired
    private TrainMealService trainMealService;

    @PostMapping("/addTrainMeal")//添加培训套餐
    public RespResult addTrainMeal(TrainMeal trainMeal){

        return trainMealService.addTrainMeal(trainMeal);
    }


    @GetMapping("/showMealPriceInfo")//显示套餐价格详情
    public RespResult showMealPriceInfo(){

        return trainMealService.showMealPriceInfo();
    }

    @GetMapping("/queryAllTrainMeal")//查询全部培训套餐
    public RespResult queryAllTrainMeal(QueryTrainMealDTO queryTrainMealDTO){

        return trainMealService.queryAllTrainMeal(queryTrainMealDTO);
    }

    @GetMapping("/queryTrainMealByName")//查询id培训套餐信息
    public RespResult queryTrainMealByName(String mealName){

        return trainMealService.queryTrainMealByName(mealName);
    }

    @PostMapping("/updateTrainMeal")
    public RespResult updateTrainMeal(TrainMeal trainMeal){//更新培训套餐

        return trainMealService.updateTrainMeal(trainMeal);
    }

}
